package cn.luischen.utils;

import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Component;
import com.github.pagehelper.PageInfo;
import com.vdurmont.emoji.EmojiParser;
import cn.luischen.constant.WebConst;
import cn.luischen.model.ContentDomain;

import static org.junit.Assert.*;
import static org.mockito.ArgumentMatchers.*;
import static org.mockito.Mockito.*;
import org.junit.Rule;
import org.junit.runner.RunWith;
import org.junit.rules.ExpectedException;
import org.junit.Test;
import org.powermock.api.mockito.PowerMockito;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.core.classloader.annotations.PowerMockIgnore;
import org.powermock.modules.junit4.PowerMockRunner;
import org.powermock.reflect.Whitebox;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;
import org.mockito.stubbing.Answer;
import java.lang.reflect.Method;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.TypeReference;
import com.alibaba.fastjson.parser.ParserConfig;
import java.util.Map;
import java.util.List;
import com.unitspirit.runtime.*;

/**
 * The class contains tests for the class cn.luischen.utils.Commons.
 *
 * @generatedBy UnitSpirit CreateTemplateTestFile4
 * @version 1.0.9.11 
 */
@PowerMockIgnore({ "javax.management.*" })
@RunWith(PowerMockRunner.class)
@PrepareForTest({ cn.luischen.utils.UUID.class })
public class Commons_random_WGTest {
	@Rule
	public ExpectedException unitspirit_thrown = ExpectedException.none();

	/**
	 * 测试方法初始化.
	 * 
	 * @throws Exception 
	 *         if the initialization fails for some reason 
	 *  
	 * @generatedBy UnitSpirit at 2021-12-06 21:50:32
	 */
	@org.junit.Before
	public void setUp() throws Exception {
		try {
			GlobalUnitInit.init();
			MockitoAnnotations.initMocks(this);
			ParserConfig.getGlobalInstance().setAutoTypeSupport(true);
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}

	/**
	 * @date 2021-12-06 21:50:32
	 * @see cn.luischen.utils.Commons#random
	 * @category auto generate by UnitSpirit  
	 */
	@Test
	public void test_random_20211109_110522_663_1_01() throws Throwable {
		int int_p_0 = 5;
		String String_p_1 = ".png";
		//返回值定义 
		String result_expected = "1.png";

		PowerMockito.mockStatic(cn.luischen.utils.UUID.class);
		java.lang.Integer mock_result_Integer1 = 1;

		PowerMockito.when(
				cn.luischen.utils.UUID.random(Mockito.anyInt(),
						Mockito.anyInt())).thenReturn(mock_result_Integer1);

		String unitspirit_result = cn.luischen.utils.Commons.random(int_p_0,
				String_p_1);
		//getAssertCase 
		UnitAssert.assertEquals(result_expected, unitspirit_result);
	}

}
